package com.ruoyi.tongyan.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.tongyan.service.TReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/tongyan/review/closure")
public class TClosureReviewController extends BaseController {

    @Autowired
    private TReviewService tReviewService;

    /**
     * 结题和专家评审关联
     * @param closureIds
     * @param userId
     * @return
     */
    @PostMapping("/{closureIds}/{userId}")
    public AjaxResult assignExpert(@PathVariable Long[] closureIds, @PathVariable Long userId){
        return toAjax(tReviewService.assignClosure(closureIds,userId));
    }

    /**
     * 专家通过结题
     * @param closureId
     * @return
     */
    @PutMapping("/pass/{closureId}")
    public AjaxResult passClosure(@PathVariable Long closureId){
        return toAjax(tReviewService.passClosure(closureId));
    }

    /**
     * 专家未通过结题
     * @param closureId
     * @return
     */
    @PutMapping("/reject/{closureId}")
    public AjaxResult rejectClosure(@PathVariable Long closureId){
        return toAjax(tReviewService.rejectClosure(closureId));
    }
}
